package cn.bud.msgbus.utils;

/**
 * BusUtils
 *
 * @author hxj
 * @version 1.0
 * @description
 * @date 2024-07-18 18:19
 */
public class BusUtils {
    public static void sleep(long mSec) {
        long sleepMSec = mSec;
        long endMSec = System.currentTimeMillis() + mSec;
        do {
            try {
                Thread.sleep(sleepMSec);
            } catch (Exception e) {
            }
            long curMSec = System.currentTimeMillis();
            if (curMSec >= endMSec) {
                break;
            }
            sleepMSec = endMSec - curMSec;
        } while (true);
    }
}
